Learning Rate


LearnRate

Gradient

The gradient is commonly used to find the optimum weights of an artificial neural network. The example below shows how to use the gradient to find the minimum of z. The example uses a learning rate of 0.01. At each iteration, the next value of x is computed by subtracting a fraction of the derivative of z with respect x.
El gradiente es comúnmente usado para encontrar los valores óptimos de los pesos de una red neural artificial. El ejemplo de abajo muestra cómo usar el gradiente para encontrar el mínimo de z. El ejemplo usa una razón de aprendizaje de 0.01. En cada iteración, el valor siguiente de x es calculado restando una fracción de la derivada de z con respecto a x.

GradExample1

GradExample2

Momentum

An alternative method to update the weights is shown below. In this case, the weights are updated using the current gradient and a fraction of the previous gradient. This method requires two values that need to be adjusted: the learning rate and the momentum.
Un método alternativo para actualizar los pesos se muestra debajo. En este caso, los pesos son actualizados usando el gradiente corriente y una fracción del gradiente previo. El método requiere dos valores que deben ser ajustados: la razón de aprendizaje y el momento.

MomExample1

MomExample2

Problem 1
Use your favorite programming language to create a program called LearnOptim to use the gradient to find the values of x and y that produce the minimum value of z in the equation below. The figure below shows an application created a Wintempla application with a List View control.
Use su lenguaje favorito de programación para crear un programa llamado LearnOptim para usar el gradiente para calcular los valores de x yy que producen el valor mínimo de z en la ecuación de abajo. La figura de abajo muestra un programa creado con Wintempla usando un control de List View.

equation

Opt01_000

Opt001_000

Opt1_000

Opt_mom

LearnOptim.cpp
void LearnOptim::Window_Open(Win::Event& e)
{
     //________________________________________________________ 1. Set initial values
     this->tbxIterations.IntValue = 25;
     this->tbxLearnRate.DoubleValue = 0.01;
     this->tbxMomentum.DoubleValue = 0.0;
     this->tbxX1.DoubleValue = 6.0;
     this->tbxY1.DoubleValue = 5.0;
     //________________________________________________________ 2. List View column setup
     const int colWidth = (int)((lvOut.Width - Sys::Metrics::GetVScrollWidth() - 5.0)/8.0);
     lvOut.Cols.Add(0, LVCFMT_LEFT, colWidth, L"No");
     lvOut.Cols.Add(1, LVCFMT_RIGHT, colWidth, L"x");
     lvOut.Cols.Add(2, LVCFMT_RIGHT, colWidth, L"y");
     lvOut.Cols.Add(3, LVCFMT_RIGHT, colWidth, L"z");
     lvOut.Cols.Add(4, LVCFMT_RIGHT, colWidth, L"dz/dx");
     lvOut.Cols.Add(5, LVCFMT_RIGHT, colWidth, L"dz/dy");
     lvOut.Cols.Add(6, LVCFMT_RIGHT, colWidth, L"deltaX");
     lvOut.Cols.Add(7, LVCFMT_RIGHT, colWidth, L"deltaY");
}

void LearnOptim::btOptimize_Click(Win::Event& e)
{
     lvOut.DeleteAllItems();
     const double learnRate = tbxLearnRate.DoubleValue;
     const double momentum = tbxMomentum.DoubleValue;
     const int numIterations = tbxIterations.IntValue;
     double x = tbxX1.DoubleValue;
     double y = tbxY1.DoubleValue;
     double dz_dx = 0.0, dz_dy = 0.0, deltaX = 0.0, deltaY = 0.0;
     . . .
}


Problem 2
Indicate what could happen, if the learning rate is too small.
Indique que podría pasar, si la razón de aprendizaje es muy pequeña.

Problem 3
Indicate what could happen, if the learning rate is too high.
Indique que podría pasar, si la razón de aprendizaje es muy grande.

Problem 4
Search over the Internet about the benefits of the momentum.
Busque en la Internet sobre los beneficios del momentum.

Problem 5
Search over the Internet about adding too much momentum.
Busque en la Internet sobre agregar mucho momentum.

Problem 6
Download a research paper about how to update the learning rate in deep learning. Write a 300 words summary to describe the method and the obtained results. Do not forget to include the title of the paper, the names of the authors, the journal name and the year of publication.
Descargue un artículo de investigación sobre como actualizar la razón de aprendizaje en el aprendizaje profundo. Escriba un resumen de 300 palabras para describiendo el método y los resultados obtenidos. No se olvide de incluir el título del artículo, los nombres de los autores, el nombre de la revista y el año de publicación.

© Copyright 2000-2021 Wintempla selo. All Rights Reserved. Jul 22 2021. Home